package com.example.demo;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.CircleCrop;
import com.bumptech.glide.request.RequestOptions;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);


        ImageView imageView1 = findViewById(R.id.imageView1);
        Glide.with(this)
                .load("https://puui.qpic.cn/vpic_cover/v3526zkfac9/v3526zkfac9_1691503994_vt.jpg/720")
                .into(imageView1);


        ImageView imageView2 = findViewById(R.id.imageView2);
        Glide.with(this)
                .load("https://puui.qpic.cn/vpic_cover/t35263to2eo/t35263to2eo_1691636724_hz.jpg/1280")
                .transform(new CircleCrop())
                .into(imageView2);


        ImageView imageView3 = findViewById(R.id.imageView3);
        /*RequestOptions options = new RequestOptions()
                // 正在请求图片时显示的图片（没设置为没有）
                .placeholder(R.drawable.ic_launcher_foreground)
                // 请求出错时显示的图片（没设置是placeholder）
                .error(R.mipmap.ic_launcher)
                // 如果请求的url/model为null显示（没设置是placeholder）
                .fallback(R.drawable.ic_launcher_foreground)
                // 指定图片大小
                .override(100, 100);
        Glide.with(this)
                .load("https://puui.qpic.cn/vpic_cover/t35263to2eo/t35263to2eo_1691636724_hz.jpg/1280")
                .transform(new CircleCrop())
                .apply(options)
                .into(imageView3);*/
        Glide.with(this)
                .load("https://puui.qpic.cn/vpic_cover/t35263to2eo/t35263to2eo_1691636724_hz.jpg/1280")
                .transform(new CircleCrop())
                .placeholder(R.drawable.ic_launcher_foreground)
                .error(R.mipmap.ic_launcher)
                .fallback(R.drawable.ic_launcher_foreground)
                .into(imageView3);


    }
}